package com.zzxx.mapper;

import com.zzxx.entity.TicketSchedule;
import com.zzxx.entity.TicketScheduleExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface TicketScheduleMapper extends  TicketScheduleMapperEx{
    @SelectProvider(type=TicketScheduleSqlProvider.class, method="countByExample")
    long countByExample(TicketScheduleExample example);

    @DeleteProvider(type=TicketScheduleSqlProvider.class, method="deleteByExample")
    int deleteByExample(TicketScheduleExample example);

    @Delete({
        "delete from ticketschedule",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    @Insert({
        "insert into ticketschedule (id, ticketId, ",
        "startTime, endTime, ",
        "lastNum, date)",
        "values (#{id,jdbcType=VARCHAR}, #{ticketid,jdbcType=VARCHAR}, ",
        "#{starttime,jdbcType=TIMESTAMP}, #{endtime,jdbcType=TIMESTAMP}, ",
        "#{lastnum,jdbcType=INTEGER}, #{date,jdbcType=DATE})"
    })
    int insert(TicketSchedule row);

    @InsertProvider(type=TicketScheduleSqlProvider.class, method="insertSelective")
    int insertSelective(TicketSchedule row);

    @SelectProvider(type=TicketScheduleSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="ticketId", property="ticketid", jdbcType=JdbcType.VARCHAR),
        @Result(column="startTime", property="starttime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="endTime", property="endtime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="lastNum", property="lastnum", jdbcType=JdbcType.INTEGER),
        @Result(column="date", property="date", jdbcType=JdbcType.DATE)
    })
    List<TicketSchedule> selectByExample(TicketScheduleExample example);

    @Select({
        "select",
        "id, ticketId, startTime, endTime, lastNum, date",
        "from ticketschedule",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="ticketId", property="ticketid", jdbcType=JdbcType.VARCHAR),
        @Result(column="startTime", property="starttime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="endTime", property="endtime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="lastNum", property="lastnum", jdbcType=JdbcType.INTEGER),
        @Result(column="date", property="date", jdbcType=JdbcType.DATE)
    })
    TicketSchedule selectByPrimaryKey(String id);

    @UpdateProvider(type=TicketScheduleSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") TicketSchedule row, @Param("example") TicketScheduleExample example);

    @UpdateProvider(type=TicketScheduleSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") TicketSchedule row, @Param("example") TicketScheduleExample example);

    @UpdateProvider(type=TicketScheduleSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(TicketSchedule row);

    @Update({
        "update ticketschedule",
        "set ticketId = #{ticketid,jdbcType=VARCHAR},",
          "startTime = #{starttime,jdbcType=TIMESTAMP},",
          "endTime = #{endtime,jdbcType=TIMESTAMP},",
          "lastNum = #{lastnum,jdbcType=INTEGER},",
          "date = #{date,jdbcType=DATE}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(TicketSchedule row);
}